/*
 * Copyright 2010. 
 * 
 * This document may not be reproduced, distributed or used 
 * in any manner whatsoever without the expressed written 
 * permission of xrkol Corp. 
 * 
 * $Rev: Rev $
 * $Author: Author $
 * $LastChangedDate: LastChangedDate $
 *
 */

package com.xrkol.sharelib.dao.impl;

import java.util.List;

import com.xrkol.sharelib.dao.MessageDao;
import com.xrkol.sharelib.entity.Message;
import com.xrkol.sharelib.entity.Teacher;

/**
 * @author peng.xia
 *
 */
public class MessageDaoImpl extends BaseDaoImpl<Message, String> implements MessageDao{

    @Override
    public List<Message> getMessagesByUserWithPaginate(Teacher currentUser, Integer page) {
        String queryString="from Message m where m.sender=?";
        return executeQueryWithPagination(queryString, " order by m.createTime desc", page, currentUser);
    }

}
